package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:05:11
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemUserDepartmentRelateBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.Id);

        mappedDaoFields.put("sysUserId",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.SysUserId);

        mappedDaoFields.put("sysDepartmentId",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.SysDepartmentId);

        mappedDaoFields.put("departmentRole",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.DepartmentRole);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.Status);

        mappedDaoFields.put("sysUserName",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.SysUserName);

        mappedDaoFields.put("sysUserAccount",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.SysUserAccount);

        mappedDaoFields.put("departmentName",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.DepartmentName);

        mappedDaoFields.put("sysUserRemarks",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.SysUserRemarks);

        mappedDaoFields.put("sysUserStatus",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.SysUserStatus);

        mappedDaoFields.put("sysUserMobilePhone",
            com.ourteam.system.dao.ISysUserDepartmentRelateDAO.SysUserMobilePhone);
    }

    private com.ourteam.system.dao.SysUserDepartmentRelate sysUserDepartmentRelate;

    public SystemUserDepartmentRelateBean() {
        super();

        this.sysUserDepartmentRelate = new com.ourteam.system.dao.SysUserDepartmentRelate();
    }

    public SystemUserDepartmentRelateBean(
        com.ourteam.system.dao.SysUserDepartmentRelate sysUserDepartmentRelate) {
        super();

        this.sysUserDepartmentRelate = sysUserDepartmentRelate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysUserDepartmentRelate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysUserDepartmentRelate convertToSysUserDepartmentRelate() {
        return this.sysUserDepartmentRelate;
    }

    public com.ourteam.system.dao.SysUserDepartmentRelate convertTo() {
        return this.sysUserDepartmentRelate;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysUserDepartmentRelate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysUserDepartmentRelate.setId(id);
    }

    /**
     * Get sysUserId
     *
     * @return long
     */
    public long getSysUserId() {
        return (long) this.sysUserDepartmentRelate.getSysUserId();
    }

    /**
     * Set sysUserId
     *
     * @parameter long
     */
    public void setSysUserId(long sysUserId) {
        this.sysUserDepartmentRelate.setSysUserId(sysUserId);
    }

    /**
     * Get sysDepartmentId
     *
     * @return long
     */
    public long getSysDepartmentId() {
        return (long) this.sysUserDepartmentRelate.getSysDepartmentId();
    }

    /**
     * Set sysDepartmentId
     *
     * @parameter long
     */
    public void setSysDepartmentId(long sysDepartmentId) {
        this.sysUserDepartmentRelate.setSysDepartmentId(sysDepartmentId);
    }

    /**
     * Get departmentRole
     *
     * @return String
     */
    public String getDepartmentRole() {
        return (String) this.sysUserDepartmentRelate.getDepartmentRole();
    }

    /**
     * Set departmentRole
     *
     * @parameter String
     */
    public void setDepartmentRole(String departmentRole) {
        this.sysUserDepartmentRelate.setDepartmentRole(departmentRole);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysUserDepartmentRelate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysUserDepartmentRelate.setStatus(status);
    }

    /**
     * Get sysUserName
     *
     * @return String
     */
    public String getSysUserName() {
        return (String) this.sysUserDepartmentRelate.getSysUserName();
    }

    /**
     * Get sysUserAccount
     *
     * @return String
     */
    public String getSysUserAccount() {
        return (String) this.sysUserDepartmentRelate.getSysUserAccount();
    }

    /**
     * Get departmentName
     *
     * @return String
     */
    public String getDepartmentName() {
        return (String) this.sysUserDepartmentRelate.getDepartmentName();
    }

    /**
     * Get sysUserRemarks
     *
     * @return String
     */
    public String getSysUserRemarks() {
        return (String) this.sysUserDepartmentRelate.getSysUserRemarks();
    }

    /**
     * Get sysUserStatus
     *
     * @return String
     */
    public String getSysUserStatus() {
        return (String) this.sysUserDepartmentRelate.getSysUserStatus();
    }

    /**
     * Get sysUserMobilePhone
     *
     * @return String
     */
    public String getSysUserMobilePhone() {
        return (String) this.sysUserDepartmentRelate.getSysUserMobilePhone();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemUserDepartmentRelateBean) == false) {
            return false;
        } // end if

        SystemUserDepartmentRelateBean other = (SystemUserDepartmentRelateBean) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysUserDepartmentRelate tempSysUserDepartmentRelate =
            other.convertToSysUserDepartmentRelate();

        if ((tempSysUserDepartmentRelate == null) ||
                (this.sysUserDepartmentRelate == null)) {
            isEqual = false;
        } else if ((tempSysUserDepartmentRelate == this.sysUserDepartmentRelate) ||
                tempSysUserDepartmentRelate.equals(this.sysUserDepartmentRelate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemUserDepartmentRelateBean[] toArray(
        com.ourteam.system.dao.SysUserDepartmentRelate[] aSysUserDepartmentRelates) {
        return toArray(aSysUserDepartmentRelates, null);
    }

    public static SystemUserDepartmentRelateBean[] toArray(
        com.ourteam.system.dao.SysUserDepartmentRelate[] aSysUserDepartmentRelates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysUserDepartmentRelates)) {
            return new SystemUserDepartmentRelateBean[0];
        }

        int length = aSysUserDepartmentRelates.length;

        SystemUserDepartmentRelateBean[] beans = new SystemUserDepartmentRelateBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemUserDepartmentRelateBean(aSysUserDepartmentRelates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aSysUserDepartmentRelates[i] });
            }
        }

        return beans;
    }
}
